package org.groupg.practice.jide;

import javax.swing.*;
import java.net.URI;
import java.net.URL;
import java.util.Objects;

public class ButtonsIconsFactory {
    public static Icon getScaledIcon(Buttons buttons) {
        Icon icon =
        switch (buttons) {
            case COPY -> new ImageIcon(Objects.requireNonNull(URI.class.getResource("/icons/copy.png")));
            case CUT -> new ImageIcon(Objects.requireNonNull(URI.class.getResource("/icons/cut.png")));
            case DELETE -> new ImageIcon(Objects.requireNonNull(URI.class.getResource("/icons/delete.png")));
            case PASTE -> new ImageIcon(Objects.requireNonNull(URI.class.getResource("/icons/paste.png")));
            case REFRESH -> new ImageIcon(Objects.requireNonNull(URI.class.getResource("/icons/refresh.png")));
            case UNDO -> new ImageIcon(Objects.requireNonNull(URI.class.getResource("/icons/undo.png")));
            case REDO -> new ImageIcon(Objects.requireNonNull(URI.class.getResource("/icons/redo.png")));
            case HISTORY -> new ImageIcon(Objects.requireNonNull(URI.class.getResource("/icons/history.png")));
        };

        return icon;
    }

    public enum Buttons{
        COPY,
        CUT,
        DELETE,
        PASTE,
        REFRESH,
        UNDO,
        REDO,
        HISTORY,
    }
}
